package com.example.armmvvm.ui.fallview

import android.view.View

/**
 *  author : yanghaozhang
 *  date : 2022/10/19 10:55
 *  description :
 */


enum class FallViewMode {
    // 只有展开形态,此时STATE_EXPANDED==STATE_COLLAPSED==STATE_ANCHOR
    ONE_STATE,

    // 两种形态(折叠/展开,展开状态高度为父布局的高度,一般为屏幕高度),此时STATE_COLLAPSED==STATE_ANCHOR
    TWO_STATE,

    // 两种形态(折叠/展开,展开状态高度为View自身高度),此时STATE_COLLAPSED==STATE_ANCHOR,且STATE_EXPANDED不在顶部
    TWO_NO_TOP_STATE,

    // 三种形态(折叠/中间/展开,展开状态高度为父布局的高度,一般为屏幕高度)
    THREE_STATE,

    // 三种形态(折叠/中间/展开,展开状态高度为View自身高度)
    THREE_NO_TOP_STATE,
}

typealias BottomFallViewDismissListener = () -> Unit

typealias OnStateChangedFunction = (bottomSheet: View, oldState: Int, newState: Int) -> Unit

typealias OnSlideFunction = (bottomSheet: View, slideOffset: Float) -> Unit

interface IFallView {
    fun show()
    fun dismiss()
    fun onDismiss()
    fun isShowing(): Boolean

    /**
     * 修改界面展示
     */
    fun updateView(view: View)

    /**
     * 展示结束后
     */
    fun afterShow(view: View) {}
}